import { createApp } from 'vue'
import App from '@/App.vue'

import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
//坑：忽略当前文件ts类型的检测否则有红色提示(打包会失败)
//@ts-ignore
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'

const app = createApp(App)

//安装element-plus插件
app.use(ElementPlus, {
  locale: zhCn,
})

console.log(import.meta.env)
import 'virtual:svg-icons-register'
// import SvgIcon from '@/components/SvgIcon/index.vue'
// app.component('SvgIcon', SvgIcon)
//引入自定义插件对象：注册整个项目全局组件
import globalComponent from '@/components'
//安装自定义插件对象
app.use(globalComponent)

//引入模板的全局样式
import '@/styles/index.scss'

// //测试假接口是否能用
// import axios from 'axios'
// //登录接口
// axios({
//   url: '/api/user/login',
//   method: 'post',
//   data: {
//     username: 'admin',
//     password: '1113111',
//   },
// })
import router from './router'
app.use(router)

import pinia from './store'
app.use(pinia)

//引入路由鉴权文件
import './permisstion'

app.mount('#app')
